import React from 'react';
import { MyContext } from './MyContext';

export default function Loading() {
    console.log('re-render Loading');
    const { state } = React.useContext(MyContext);
    return state.loading ? (
        <div className=' absolute top-0 left-0 bottom-0 right-0 flex items-center justify-center'>加载中...</div>
    ) : null;
}
